home *** CD-ROM | disk | FTP | other *** search
- on SetPlayerScores
- global gzTRPlayerObj, gcTRPLYR1SCORECH, gcTRPLYR2SCORECH
- set the text of field "Player1Score" to EMPTY
- set the text of field "Player2Score" to EMPTY
- if mGetPlayMode(gTRGameObj) = 1 then
- set vScore to mGetMyCurrentScore(getAt(gzTRPlayerObj, 1))
- set the text of field "Player1Score" to string(vScore)
- set the visible of sprite gcTRPLYR1SCORECH to 1
- set the visible of sprite gcTRPLYR2SCORECH to 0
- set the locH of sprite gcTRPLYR1SCORECH to 333
- set the locV of sprite gcTRPLYR1SCORECH to 432
- puppetSprite(gcTRPLYR1SCORECH, 1)
- else
- set vScore1 to mGetMyCurrentScore(getAt(gzTRPlayerObj, 1))
- set vScore2 to mGetMyCurrentScore(getAt(gzTRPlayerObj, 2))
- set the text of field "Player1Score" to string(vScore1)
- set the text of field "Player2Score" to string(vScore2)
- set the locH of sprite gcTRPLYR1SCORECH to 230
- set the locV of sprite gcTRPLYR1SCORECH to 431
- set the visible of sprite gcTRPLYR1SCORECH to 1
- set the visible of sprite gcTRPLYR2SCORECH to 1
- end if
- SetScoreAttribs()
- updateStage()
- end
-
- on PlaceTurnDart
- global gcTRTURNDARTCH, gTRGameObj
- if mGetPlayMode(gTRGameObj) = 1 then
- set the visible of sprite gcTRTURNDARTCH to 0
- return
- end if
- if mGetWhosTurn(gTRGameObj) = 1 then
- set the castNum of sprite gcTRTURNDARTCH to the number of cast "DartPlayer1"
- set the locV of sprite gcTRTURNDARTCH to 425
- set the locH of sprite gcTRTURNDARTCH to 167
- else
- set the castNum of sprite gcTRTURNDARTCH to the number of cast "DartPlayer2"
- set the locV of sprite gcTRTURNDARTCH to 425
- set the locH of sprite gcTRTURNDARTCH to 460
- end if
- set the visible of sprite gcTRTURNDARTCH to 1
- puppetSprite(gcTRTURNDARTCH, 1)
- updateStage()
- end
-
- on SwapTurns
- global gTRGameObj
- if mGetWhosTurn(gTRGameObj) = 1 then
- mSetWhosTurn(gTRGameObj, 2)
- else
- mSetWhosTurn(gTRGameObj, 1)
- end if
- end
-
- on DoDoubleValues
- global gzTRBalloonObj, gcTRBAL_CH1, gcTR_DOUBLE3_CH
- set vBalloonNums to list()
- set vKeepItUp to 1
- set vNumLables to random(3)
- repeat while vKeepItUp
- set vNum to random(30)
- if not getPos(vBalloonNums, vNum) then
- append(vBalloonNums, vNum)
- end if
- if count(vBalloonNums) > 2 then
- set vKeepItUp to 0
- end if
- end repeat
- mSetAmIDouble(getAt(gzTRBalloonObj, getAt(vBalloonNums, 1)), 1)
- mSetHaveIBeenDouble(getAt(gzTRBalloonObj, getAt(vBalloonNums, 1)), 1)
- if vNumLables > 1 then
- mSetAmIDouble(getAt(gzTRBalloonObj, getAt(vBalloonNums, 2)), 1)
- mSetHaveIBeenDouble(getAt(gzTRBalloonObj, getAt(vBalloonNums, 2)), 1)
- end if
- if vNumLables > 2 then
- mSetAmIDouble(getAt(gzTRBalloonObj, getAt(vBalloonNums, 3)), 1)
- mSetHaveIBeenDouble(getAt(gzTRBalloonObj, getAt(vBalloonNums, 3)), 1)
- end if
- end
-
- on EraseScoreBoard
- global gcTRROVER
- set the castNum of sprite gcTRROVER to the number of cast "BlankScoreBoard"
- set the locH of sprite gcTRROVER to 320
- set the locV of sprite gcTRROVER to 436
- updateStage()
- end
-
- on myDelay aTicks
- startTimer()
- repeat while the timer < aTicks
- nothing()
- end repeat
- end
-
- on TurnOnScoreBoards
- global gcTRSCOREBRD_CH, gcTRPLYR1SCORECH, gcTRPLYR2SCORECH
- puppetSprite(gcTRPLYR1SCORECH, 1)
- puppetSprite(gcTRPLYR2SCORECH, 1)
- puppetSprite(gcTRSCOREBRD_CH, 1)
- if mGetPlayMode(gTRGameObj) = 1 then
- set the castNum of sprite gcTRSCOREBRD_CH to the number of cast "SinglePlayerScoreBoard"
- set the locH of sprite gcTRSCOREBRD_CH to 320
- set the locV of sprite gcTRSCOREBRD_CH to 446
- set the visible of sprite gcTRSCOREBRD_CH to 1
- set the visible of sprite gcTRPLYR1SCORECH to 1
- else
- set the castNum of sprite gcTRSCOREBRD_CH to the number of cast "DoublePlayerScoreBoard"
- set the locH of sprite gcTRSCOREBRD_CH to 316
- set the locV of sprite gcTRSCOREBRD_CH to 446
- set the visible of sprite gcTRSCOREBRD_CH to 1
- set the visible of sprite gcTRPLYR1SCORECH to 1
- set the visible of sprite gcTRPLYR2SCORECH to 1
- end if
- updateStage()
- end
-
- on ShowQuestionWindow
- global gTRGameObj, gcTRROVER, gTRButtInhibit
- set gTRButtInhibit to 1
- set vAnswerRect to list()
- addAt(vAnswerRect, 1, rect(153, 210, 500, 245))
- addAt(vAnswerRect, 2, rect(153, 255, 500, 287))
- addAt(vAnswerRect, 3, rect(153, 295, 500, 330))
- addAt(vAnswerRect, 4, rect(395, 333, 500, 353))
- set vOnTheButton to 0
- set vDontKnow to 0
- set vPlayMode to mGetPlayMode(gTRGameObj)
- if vPlayMode = 1 then
- ShowOneTwoLabel("one", 349, 115)
- else
- if mGetWhosTurn(gTRGameObj) = 1 then
- ShowOneTwoLabel("one", 349, 115)
- else
- ShowOneTwoLabel("two", 349, 115)
- end if
- end if
- set vBeenUp to 0
- set vKeepItUp to 1
- repeat while vKeepItUp
- set vMouse to point(the mouseH, the mouseV)
- if vBeenUp = 0 then
- set vBeenUp to the mouseUp
- end if
- set vRect to 0
- repeat with vI = 1 to 4
- if inside(vMouse, getAt(vAnswerRect, vI)) then
- set vRect to vI
- if vRect = 4 then
- set the castNum of sprite 47 to cast "DontKnowButton.RollOver"
- set the castNum of sprite gcTRROVER to the number of cast "D:"
- updateStage()
- else
- set the castNum of sprite 47 to cast "DontKnowButton"
- updateStage()
- RollOverAnswers(vRect)
- end if
- exit repeat
- end if
- end repeat
- if vRect = 0 then
- RollOverAnswers(0)
- end if
- if the mouseDown and (vOnTheButton = 0) and vBeenUp then
- if vRect = 4 then
- set gTRButtInhibit to 0
- repeat while the mouseDown and inside(vMouse, getAt(vAnswerRect, 4))
- set the castNum of sprite 47 to the number of cast "DontKnowButton.dep"
- updateStage()
- set vMouse to point(the mouseH, the mouseV)
- set vOnTheButton to 1
- if the mouseUp and inside(vMouse, getAt(vAnswerRect, 4)) then
- ComputeScore(0)
- set vKeepItUp to 0
- set vOnTheButton to 0
- set vDontKnow to 1
- updateStage()
- repeat while soundBusy(1)
- nothing()
- end repeat
- end if
- end repeat
- else
- if vRect = 0 then
- nothing()
- set gTRButtInhibit to 0
- else
- repeat while the mouseDown
- nothing()
- end repeat
- set vMouse to point(the mouseH, the mouseV)
- if inside(vMouse, getAt(vAnswerRect, vRect)) then
- set vMouse to point(the mouseH, the mouseV)
- set vHotSpot to rect(400, 255, 500, 287)
- if not inside(vMouse, vHotSpot) then
- set gTRButtInhibit to 0
- end if
- set vKeepItUp to 0
- set vGotItRight to ComputeScore(vRect)
- else
- nothing()
- end if
- end if
- end if
- set the castNum of sprite 47 to cast "DontKnowButton"
- updateStage()
- end if
- if not inside(vMouse, getAt(vAnswerRect, 4)) then
- set the castNum of sprite 47 to cast "DontKnowButton"
- updateStage()
- end if
- if vOnTheButton then
- if (vRect <> 4) and the mouseUp then
- set vOnTheButton to 0
- end if
- end if
- end repeat
- set the visible of sprite gcTRROVER to 0
- set the locH of sprite gcTRROVER to -10
- set the locV of sprite gcTRROVER to -10
- set the trails of sprite gcTRROVER to 0
- updateStage()
- if vGotItRight then
- if mGetPopCount(gTRGameObj) = 29 then
- go("LastQuestRight")
- else
- go("ShowAnswerRight")
- puppetSprite(44, 1)
- set the castNum of sprite 44 to cast ("RIGHT" & random(27) & ".PIC")
- end if
- else
- if mGetPopCount(gTRGameObj) = 29 then
- go("LastQuestWrong")
- else
- go("ShowAnswerWrong")
- end if
- if vDontKnow then
- puppetSprite(44, 0)
- else
- puppetSprite(44, 1)
- set the castNum of sprite 44 to cast ("WRONG" & random(26) & ".PIC")
- end if
- end if
- if vPlayMode = 1 then
- ShowOneTwoLabel("one", 349, 177)
- else
- if mGetWhosTurn(gTRGameObj) = 1 then
- ShowOneTwoLabel("two", 349, 177)
- else
- ShowOneTwoLabel("one", 350, 177)
- end if
- end if
- end
-
- on ShowOneTwoLabel aPlayer, aH, aV
- global gcTRROVER
- if aPlayer = "one" then
- set the castNum of sprite gcTRROVER to the number of cast "OneLabel"
- else
- set the castNum of sprite gcTRROVER to the number of cast "TwoLabel"
- end if
- set the locH of sprite gcTRROVER to aH
- set the locV of sprite gcTRROVER to aV
- set the visible of sprite gcTRROVER to 1
- set the trails of sprite gcTRROVER to 1
- updateStage()
- set the castNum of sprite gcTRROVER to the number of cast "gRover"
- set the locH of sprite gcTRROVER to -10
- set the locV of sprite gcTRROVER to -10
- updateStage()
- end
-
- on NextRound
- global gTRGameObj
- mIncrementPopCount(gTRGameObj)
- PlaceTurnDart()
- end
-
- on GetRandomQuestion
- global gzTR_BeenSelected
- set vRetVal to 0
- set vRetVal to random(10)
- if count(gzTR_BeenSelected) = 10 then
- set gzTR_BeenSelected to list()
- end if
- repeat while getPos(gzTR_BeenSelected, vRetVal)
- set vRetVal to random(10)
- end repeat
- append(gzTR_BeenSelected, vRetVal)
- return vRetVal
- end
-
- on TestNameLength
- global gzTRPlayerObj
- return 1
- set vMaxLength to 20
- GetPlayersNames()
- set vP1 to mGetMyName(getAt(gzTRPlayerObj, 1))
- set vP2 to mGetMyName(getAt(gzTRPlayerObj, 2))
- if length(vP1) > vMaxLength then
- alert("Player One's name is Too Long!")
- return 0
- end if
- if length(vP2) > vMaxLength then
- alert("Player Two's name is Too Long!")
- return 0
- end if
- return 1
- end
-